﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArticleManager.DataClasses
{
    public class ArticleTitle
    {
        private int article_id;
        private string article_text;

        public override string ToString()
        {
            return this.article_text;
        }
        public ArticleTitle()
        {
            article_id = 0;
            article_text = string.Empty;
        }

        public ArticleTitle(int art_id, string art_text)
        {
            article_id = art_id;
            article_text = art_text;
        }

        #region properties

        public int ArticleId
        {
            get
            {
                return this.article_id;
            }
            set
            {
                this.article_id= value;
            }
        }

        public string ArticleText
        {
            get
            {
                return this.article_text;
            }
            set
            {
                this.article_text = value;
            }
        }


        #endregion

        public class Properties
        {
            public const string Title = "title";
            public const string ArticleId = "article_id";
        }
    }

    public class ArticleTitlesCollection : System.Collections.CollectionBase
    {
        public int Add(ArticleTitle value)
        {
            return base.List.Add(value as object);
        }

        public void Remove(ArticleTitle value)
        {
            base.List.Remove(value as object);
        }

        public void Insert(int index, ArticleTitle value)
        {
            base.List.Insert(index, value as object);
        }

        public bool Contains(ArticleTitle value)
        {
            return base.List.Contains(value as object);
        }

        public ArticleTitle this[int index]
        {
            get { return base.List[index] as ArticleTitle; }
        }
    }
}
